<template>
  <div class="container">
    <topTitle
      :titleText="titleText"
      :back="back"
      @gobackTriser="goBack"
    ></topTitle>
    <div class="mainCon">
      <table cellspacing="0" cellpadding="0" style="table-layout: fixed">
        <tbody>
          <tr>
            <td class="title">年份：</td>
            <td class="content">{{ enterpriseInfo.year || '--' }}</td>
            <td class="title">批次号：</td>
            <td class="content">{{ enterpriseInfo.batchNo || '--' }}</td>
          </tr>
          <tr>
            <td class="title">企业名称：</td>
            <td class="content">{{ enterpriseInfo.companyName || '--' }}</td>
            <td class="title">统一社会信用代码或工商注册号：</td>
            <td class="content">{{ enterpriseInfo.uscc || '--' }}</td>
          </tr>
          <tr>
            <td class="title">法定代表人姓名：</td>
            <td class="content">{{ enterpriseInfo.boss || '--' }}</td>
            <td class="title">法定代表人或自然人身份证号：</td>
            <td class="content">{{ enterpriseInfo.bossIdcard || '--' }}</td>
          </tr>
          <tr>
            <td class="title">涉及金额：</td>
            <td class="content">{{ enterpriseInfo.arrearage || '--' }}元</td>
            <td class="title">认定部门：</td>
            <td class="content">{{ enterpriseInfo.thatDepartment || '--' }}</td>
          </tr>
          <tr>
            <td class="title">列入日期：</td>
            <td class="content">
              {{
                common.GMTFormat(enterpriseInfo.effectiveStartDate, 1) || '--'
              }}
            </td>
            <td class="title">退出日期：</td>
            <td class="content" style="border-bottom: 1px solid #d5dfe8">
              {{ common.GMTFormat(enterpriseInfo.effectiveEndDate, 1) || '--' }}
            </td>
          </tr>
          <tr>
            <td class="title">文书号：</td>
            <td colspan="4">{{ enterpriseInfo.punishNumber || '--' }}</td>
          </tr>
          <tr>
            <td class="title">列入名单事由：</td>
            <td colspan="4">{{ enterpriseInfo.reason || '--' }}</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</template>
<script>
export default {
  name: 'blackOrdersDetail',
  data() {
    return {
      titleText: '拖欠农民工工资"黑名单"详情',
      back: true,
      enterpriseInfo: {
        companyName: '',
        uscc: '',
        boss: '',
        bossIdcard: '',
        arrearage: '',
        thatDepartment: '',
        effectiveStartDate: '',
        effectiveEndDate: '',
        punishNumber: '',
        reason: '',
      },
    }
  },
  created() {
    this.getDetail(this.$route.query.id)
  },
  methods: {
    getDetail(id) {
      this.axios
        .post('api-r/cb/detail', { id })
        .then((response) => {
          this.enterpriseInfo = response.data.result
        })
        .catch((error) => {
          this.$message.error('数据获取失败')
        })
    },
    goBack() {
      this.$router.push('/home/kMCaseComplaint/blackOrders')
      this.$store.commit('CHANGE_SLIDER_NAME', {
        oldUrl: '/home/kMCaseComplaint/blackOrders',
        newUrl: this.$router.currentRoute.fullPath,
      })
    },
  },
}
</script>
<style scoped lang="less">
.container {
  .mainCon {
    top: 198px;
    color: #333;
    font-size: 14px;
    padding: 24px;
    table {
      width: 100%;
      border-top: 1px solid #d5dfe8;
      border-left: 1px solid #d5dfe8;
      td {
        padding: 16px 18px;
        border-bottom: 1px solid #d5dfe8;
        border-right: 1px solid #d5dfe8;
      }
      .title {
        width: 177px;
        background-color: #f5f7fc;
        font-weight: 500;
        text-align: right;
      }
      .content {
        width: 100%;
      }
      .general {
        color: #6dd400;
      }
      .serious {
        color: #e02020;
      }
      .aLink {
        color: #00a0e9;
      }
    }
  }
}
</style>
